<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>$工具方法</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="../../js/common.js" type="text/javascript"></script>
</head>
<script type="text/javascript">
    $(function (){
        // $.each():遍历数据或对象中的数据
        // $.trim():去除字符串两边的空格
        // $.type(obj):得到数据类型
        // $.isArray(obj):判断是否为数组
        // $.isFunction：判断是否为函数
        // $.parseJSON(json):解析json字符串转为js对象或数组
        function Person(name){
            this.name = name;
        }
        Person.prototype.setName = function (name){
            this.name = name;
        };
        let person = new Person();
        person.setName('tom');
        console.log(person)

        $.each(person,function (key,value){
           console.log(key , value);
        });

        console.log($.isArray(person));
        console.log($.isFunction(person.setName));
    });
</script>
<body>

</body>
</html>